#include "qmemerypropertyeditor.h"

#include "qmemeryeditor.h"

#include "../../shared/property/qabstractproperty.h"
#include "../../shared/qpropertyfactory.h"

#include <QStyle>

QMemeryPropertyEditor::QMemeryPropertyEditor(QAbstractProperty *property,QUndoStack* stack, QWidget *parent):
    QButtonCommonEditor(property,stack,parent)
{
}

void QMemeryPropertyEditor::btn_clicked()
{

    QMemeryEditor dlg(m_property,this);
    dlg.exec();
    QVariant value=dlg.get_value();
    if(value.isValid())
    {
        if(!m_property->cmp(value))
        {
            m_property->emit_edit_value(value);
        }
    }
}

qRegisterPropertyEditor(Memery,QMemeryPropertyEditor)
